package composite.composite.impl;

import composite.composite.FileSystemComponent;

/**
 * 叶子节点 (Leaf): 文件
 *
 * @author Liu Yicong
 * @date 2025/9/23
 */
public class File implements FileSystemComponent {
	private String name;
	private long size;

	public File(String name, long size) {
		this.name = name;
		this.size = size;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public long getSize() {
		return size;
	}

	@Override
	public void print() {
		System.out.println("  - 文件: " + name + " (大小: " + size + " KB)");
	}
}
